﻿<Window x:Class="BizControl.Presentation.Shell.Shell"
        xmlns:prism="http://www.codeplex.com/CompositeWPF" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:c="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
        xmlns:res="clr-namespace:BizControl.Presentation.Infrastructure.Properties;assembly=BizControl.Presentation.Infrastructure"
        xmlns:controls="clr-namespace:BizControl.Presentation.Infrastructure.Controls;assembly=BizControl.Presentation.Infrastructure"
        xmlns:infrastructure="clr-namespace:BizControl.Presentation.Infrastructure.Constants;assembly=BizControl.Presentation.Infrastructure"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
        xmlns:gauge="clr-namespace:Telerik.Windows.Controls.Gauges;assembly=Telerik.Windows.Controls.Gauge"
        xmlns:vm="clr-namespace:BizControl.Presentation.Shell.ViewModels"
        Closed="Window_Closed"
        WindowState="Maximized"
        Title="{x:Static res:Captions.BizControlMainVersion}">

    <Window.Resources>
        <Style x:Key="TransitionContent" TargetType="ContentControl">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ContentControl">
                        <telerik:RadTransitionControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"
                                                      ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" SnapsToDevicePixels="True">
                            <telerik:RadTransitionControl.Transition>
                                <telerik:SlideAndZoomTransition />
                            </telerik:RadTransitionControl.Transition>
                        </telerik:RadTransitionControl>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

    <Grid Background="{StaticResource MainBackgroundBrush}">

        <Grid.RowDefinitions>
            <RowDefinition Height="150" />
            <RowDefinition Height="*" />
            <RowDefinition Height="25" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="5" />
            <ColumnDefinition Width="5*" />
        </Grid.ColumnDefinitions>

        <!-- Top Region -->
        <Border Margin="2,2,8,8" Grid.Row="0" Grid.ColumnSpan="3" BorderThickness="2,2,2,2" CornerRadius="4,4,4,4" BorderBrush="#FF4355C1">
            <StackPanel Orientation="Horizontal">
                <Border Margin="2,2,8,8" BorderThickness="2,2,2,2" CornerRadius="4,4,4,4" BorderBrush="#FF4355C1">
                    <controls:CurrentUserControl DataContext="{Binding Path=CurrentUser}" />
                </Border>
                <Border DataContext="{Binding Path=CurrentModel}"
                        Margin="2,2,8,8" BorderThickness="2,2,2,2" CornerRadius="4,4,4,4" BorderBrush="#FF4355C1">
                    <TextBlock Text="{Binding Path=Name}" />
                </Border>
                <controls:InfoToolTipControl>
                    <StackPanel Orientation="Horizontal">
                        <Image Width="25" Height="25" Source="{StaticResource defaultUserImage}" />
                        <StackPanel MaxWidth="300">
                            <TextBlock TextWrapping="Wrap">TO DO:</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="Red">0. Remake DAL to use LINQ to SQL instead of StoredProcedures</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="Red">0. Weight %</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="Red">0. Enabled/Disabled Logic. Update cancomplete etc.</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="Red">0. Copy Task</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="Red">0. Hierarchical tasks. Progress logic</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="Red">0. Scrolling everywhere. Maximize tile from edit conditions</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="Red">0. TileView DataTemplate Exception Exception Bug. navigate to users / roles and GoBack parameter</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="Red">1. PropertyStatus ModelSelector bug. PropertyStatus Add new condition bug. Confirmation Dlg with ErrorDialog. Children Errors</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="Red">2. Children Loading Optimization! Asynchronous Loading and Cache!</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="LightBlue">3. Make Output panel with the actions results</TextBlock>
                            <TextBlock TextWrapping="Wrap">5. Logout procedure.</TextBlock>
                            <TextBlock TextWrapping="Wrap">6. Business and Presentation Layers development / review</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="LightBlue">7. !!!Update All info's objects when BO changed. EventAggregator.</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="LightBlue">8. Design OrgWare. Probably based on marks.</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="LightBlue">9. Delete child objects when delete parent.</TextBlock>
                            <TextBlock TextWrapping="Wrap" Foreground="LightBlue">10. Navigate from one activity editing to another. RightToLeft animation when GoBack. Forward and Backward</TextBlock>
                        </StackPanel>
                    </StackPanel>
                </controls:InfoToolTipControl>
                <telerik:RadRating NumberOfItemsToGenerate="3" Value="2" />
                <!--<telerik:RadGauge x:Name="radGauge" Margin="2">
                    <telerik:LinearGauge>
                        <telerik:LinearScale x:Name="linearScale" Min="0" Max="100" Left="0.5" Top="0.1" RelativeHeight="0.81">
                            <telerik:LinearScale.MajorTick>
                                <telerik:MajorTickProperties Location="OverCenter" />
                            </telerik:LinearScale.MajorTick>
                            <telerik:LinearScale.MiddleTick>
                                <telerik:MiddleTickProperties Location="OverCenter" Length="0.07" />
                            </telerik:LinearScale.MiddleTick>
                            <telerik:LinearScale.MinorTick>
                                <telerik:MinorTickProperties Location="OverCenter" Length="0.055" />
                            </telerik:LinearScale.MinorTick>

                            <telerik:LinearScale.Label>
                                <telerik:LabelProperties FontSize="9" Offset="0.02" Location="Outside" />
                            </telerik:LinearScale.Label>

                            <telerik:RangeList>
                                <telerik:LinearRange Min="0" Max="50" StartWidth="0.04"
									EndWidth="0.04" Location="OverCenter"
									Background="Green" BorderBrush="#7FFFFFFF" />
                                <telerik:LinearRange Min="50" Max="75" StartWidth="0.04"
									EndWidth="0.04" Location="OverCenter"
									Background="Yellow" BorderBrush="#7FFFFFFF" />
                                <telerik:LinearRange Min="75" Max="100" StartWidth="0.04"
									EndWidth="0.04" Location="OverCenter"
									Background="Red" BorderBrush="#7FFFFFFF" />
                            </telerik:RangeList>

                            <telerik:IndicatorList>
                                <telerik:Marker x:Name="gauge1_marker" Value="67"
									RelativeHeight="0.04" RelativeWidth="0.08" IsAnimated="True" />
                            </telerik:IndicatorList>
                        </telerik:LinearScale>
                    </telerik:LinearGauge>
                </telerik:RadGauge>-->
                <StackPanel>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2">
                        <Hyperlink Command="{Binding Path=LogoutCommand}">
                            <TextBlock Text="Сменить пользователя" />
                        </Hyperlink>
                    </TextBlock>
                    <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2">
                        <Hyperlink Command="{Binding Path=ExitCommand}">
                            <TextBlock Text="Выйти из системы" />
                        </Hyperlink>
                    </TextBlock>
                </StackPanel>
            </StackPanel>
        </Border>

        <ContentControl Margin="2" Grid.Row="1" Grid.Column="2" Style="{StaticResource TransitionContent}"
                        prism:RegionManager.RegionName="{x:Static infrastructure:ShellRegionNames.MainContentRegion}" 
                        HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>

        <c:GridSplitter Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Background="{x:Null}" />

        <Border Margin="2" Grid.Row="1" BorderThickness="2,2,2,2" BorderBrush="#FF4355C1">
            <telerik:RadPanelBar telerik:Theming.Theme="Metro" Margin="2" ExpandMode="Single" VerticalAlignment="Top" HorizontalAlignment="Stretch">
                <telerik:RadPanelBarItem IsExpanded="True" Header="Основное">
                    <StackPanel prism:RegionManager.RegionName="{x:Static infrastructure:ShellRegionNames.MainNavigationRegion}"
                                HorizontalAlignment="Left" VerticalAlignment="Top" />
                </telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem IsExpanded="False" Header="Анализ данных">
                    <StackPanel prism:RegionManager.RegionName="{x:Static infrastructure:ShellRegionNames.DataAnalysisNavigationRegion}"
                                HorizontalAlignment="Left" VerticalAlignment="Top" />
                </telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem IsExpanded="False" Header="Дополнительно">
                    <StackPanel prism:RegionManager.RegionName="{x:Static infrastructure:ShellRegionNames.InfoNavigationRegion}"
                                HorizontalAlignment="Left" VerticalAlignment="Top" />
                </telerik:RadPanelBarItem>
            </telerik:RadPanelBar>
        </Border>

        <StatusBar Grid.Row="2" Grid.ColumnSpan="3">
            <TextBlock Text="{x:Static res:Captions.BizControlMainVersion}" />
        </StatusBar>

    </Grid>
</Window>
